function NativeExtensionSample() {
};

NativeExtensionSample.prototype.executeSample = function(successCallback, errorCallback, options, arg0, arg1, arg2) {
	if(device.platformName == "Android") {
		var optionQuery = [];
		
		for(var name in options) {
			if(options[name] != "" && options[name] != "null" && options[name] != null && options[name] != undefined && options[name] != "undefined")
				optionQuery.push(name + "=" + options[name]);
		}
		nativeExtensionSampleD.executeSample(GetFunctionName(successCallback), GetFunctionName(errorCallback), optionQuery.join("&"), arg0, arg1, arg2);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
		var optionQuery = [];
		
		for(var name in options) {
			if(options[name] != "" && options[name] != "null" && options[name] != null && options[name] != undefined && options[name] != "undefined")
				optionQuery.push(name + "=" + options[name]);
		}
		nativeExtensionD.executeSample(GetFunctionName(successCallback), GetFunctionName(errorCallback), optionQuery.join("&"), arg0, arg1, arg2);
	} else if(device.platformName == "iPhone") {
		AlopexGap.exec("NativeExtensionSample.executeSample", GetFunctionName(successCallback), GetFunctionName(errorCallback), options, arg0, arg1, arg2);
	}
};


NativeExtensionSample.prototype.executeUISample = function(successCallback, errorCallback, options, arg0, arg1, arg2) {
	if(device.platformName == "Android") {
		var optionQuery = [];
		
		for(var name in options) {
			if(options[name] != "" && options[name] != "null" && options[name] != null && options[name] != undefined && options[name] != "undefined")
				optionQuery.push(name + "=" + options[name]);
		}
		nativeExtensionSampleD.executeUISample(GetFunctionName(successCallback), GetFunctionName(errorCallback), optionQuery.join("&"), arg0, arg1, arg2);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
		var optionQuery = [];
		
		for(var name in options) {
			if(options[name] != "" && options[name] != "null" && options[name] != null && options[name] != undefined && options[name] != "undefined")
				optionQuery.push(name + "=" + options[name]);
		}
		nativeExtensionD.executeUISample(GetFunctionName(successCallback), GetFunctionName(errorCallback), optionQuery.join("&"), arg0, arg1, arg2);
	} else if(device.platformName == "iPhone") {
		AlopexGap.exec("NativeExtensionSample.executeUISample", GetFunctionName(successCallback), GetFunctionName(errorCallback), options, arg0, arg1, arg2);
	}
};


function QRCodeTookit() {
};

QRCodeTookit.prototype.executeQRCode = function(successCallback, errorCallback) {
	if(device.platformName == "Android") {
		qrToolkitExtensionD.executeQRCode(GetFunctionName(successCallback), GetFunctionName(errorCallback));
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("QRToolkitExtension.executeQRCode", GetFunctionName(successCallback), GetFunctionName(errorCallback));
	}
};

function ARTookit() {
};

ARTookit.prototype.executeARMode = function(successCallback, errorCallback, json, latitude, longitude) {
	if(device.platformName == "Android") {
		arToolkitExtensionD.executeARMode(GetFunctionName(successCallback), GetFunctionName(errorCallback), json, latitude, longitude);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
		AlopexGap.exec("ARToolkitExtension.executeARMode", GetFunctionName(successCallback), GetFunctionName(errorCallback), json, latitude, longitude);
	}
};

function SNSToolkit() {
};

SNSToolkit.prototype.loadTwitterLogin = function(msg, url) {
	if(device.platformName == "Android") {
		snsToolkitExtensionD.loadTwitterLogin(msg, url);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        try {
            AlopexGap.exec("SNSToolkitExtension.loadTwitterLogin", msg, url);
        } catch(e) {alert(e);}
	}
};

SNSToolkit.prototype.loadFacebookLogin = function(msg, link, name, caption, desc) {
	if(device.platformName == "Android") {
		snsToolkitExtensionD.loadFacebookLogin(msg, link, name, caption, desc);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        try {
        AlopexGap.exec("SNSToolkitExtension.loadFacebookLogin", msg, link, name, caption, desc);
        } catch(e) {alert(e);}
	}
};

SNSToolkit.prototype.httpRequest = function(url, method, parameters, successCallback, errorCallback) {
	if(device.platformName == "Android") {
		var params="";
		for(var i in parameters) {
			if(method.toUpperCase() == "GET")
				params += i+"="+decodeURIComponent(parameters[i])+"&";
			else
				params += i+"="+parameters[i]+"&";
		}
		params = params.substring(0, params.length-1);
		
		http.successCallback = successCallback;
		http.errorCallback = errorCallback;
		nativeExtensionD.httpPostRequest(url, method, params);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
	}
};

function SecureKeypadTookit() {
};

SecureKeypadTookit.prototype.executeSecureKeypad = function(successCallback, errorCallback) {
	if(device.platformName == "Android") {
		secureKeypadToolkitExtensionD.execureSecureKeypad(GetFunctionName(successCallback), GetFunctionName(errorCallback));
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("TransKeyToolkitExtension.execureSecureKeypad", GetFunctionName(successCallback), GetFunctionName(errorCallback));
	}
};

/*******************************************************************************
 * CertToolkit 인증서 연동 모듈 
 ******************************************************************************/
function CertTookit() {
	this.successCallback = null;
	this.failureCallback = null;
	
	this.resposne = null;
	this.error = null;
};

/*******************************************************************************
 * request
 * 암호화 서버 연결, params : 
 ******************************************************************************/
CertTookit.prototype.request = function(url, method, params, successCallback, errorCallback) {
	var query = "";
	
	for(var name in params)
		query += (name + "=" + params[name] + "&");
	
	query = query.substring(0, query.length - 1);
	
	this.successCallback = successCallback;
	this.errorCallback = errorCallback;
	
	if(device.platformName == "Android") {
		certToolkitExtensionD.request(url, method, query, successCallback, errorCallback);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.request", url, method, params, GetFunctionName(successCallback), GetFunctionName(errorCallback), url, method, params);
	}
};

/*******************************************************************************
 * executeCertLogin
 * 인증서 로그인 
 ******************************************************************************/
CertTookit.prototype.executeCertLogin = function(successCallback, errorCallback) {
	if(device.platformName == "Android") {
		certToolkitExtensionD.executeCertLogin(GetFunctionName(successCallback), GetFunctionName(errorCallback));
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.executeCertLogin", GetFunctionName(successCallback), GetFunctionName(errorCallback));
	}
};

/*******************************************************************************
 * executeCertSignData
 * 인증서 데이터 서명
 ******************************************************************************/
CertTookit.prototype.executeCertSignData = function(successCallback, errorCallback, data) {
	if(device.platformName == "Android") {
		certToolkitExtensionD.executeCertSignData(GetFunctionName(successCallback), GetFunctionName(errorCallback), data);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.executeCertSignData", GetFunctionName(successCallback), GetFunctionName(errorCallback), data);
	}
};

/*******************************************************************************
 * executeCertManager
 * 인증서 관리자 
 ******************************************************************************/
CertTookit.prototype.executeCertManager = function(successCallback, errorCallback) {
	if(device.platformName == "Android") {
		certToolkitExtensionD.executeCertManager(GetFunctionName(successCallback), GetFunctionName(errorCallback));
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.executeCertManager", GetFunctionName(successCallback), GetFunctionName(errorCallback));
	}
};

/*******************************************************************************
 * executeCertImporter
 * 인증서 가져오기 
 ******************************************************************************/
CertTookit.prototype.executeCertImporter = function(successCallback, errorCallback) {
	if(device.platformName == "Android") {
		certToolkitExtensionD.executeCertImporter(GetFunctionName(successCallback), GetFunctionName(errorCallback));
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.executeCertImporter", GetFunctionName(successCallback), GetFunctionName(errorCallback));
	}
};

/*******************************************************************************
 * executeCertWeb
 * 모바일웹 인증서 연동, 납부페이지 연동에 쓰임
 ******************************************************************************/
CertTookit.prototype.executeCertWeb = function(successCallback, errorCallback, url) {
	if(device.platformName == "Android") {
		certToolkitExtensionD.executeCertWeb(GetFunctionName(successCallback), GetFunctionName(errorCallback), url);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("CertToolkitExtension.executeCertWeb", GetFunctionName(successCallback), GetFunctionName(errorCallback), url);
	}
};

function DocViewerTookit() {
};

DocViewerTookit.prototype.executeOpen = function(successCallback, errorCallback, file) {
	if(device.platformName == "Android") {
		docViewerToolkitExtensionD.executeOpen(GetFunctionName(successCallback), GetFunctionName(errorCallback), file);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
	}
};

DocViewerTookit.prototype.loadLogin = function() {
	if(device.platformName == "Android") {
		docViewerToolkitExtensionD.loadLogin();
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
	}
};

function StreamDocViewerTookit() {
};

StreamDocViewerTookit.prototype.executeOpen = function(successCallback, errorCallback, json) {
	if(device.platformName == "Android") {
		streamDocViewerToolkitExtensionD.executeOpen(GetFunctionName(successCallback), GetFunctionName(errorCallback), json);
	} else if(device.platformName == "simulator") {
	} else if(device.platformName == "BlackBerry") {
	} else if(device.platformName == "iPhone") {
        AlopexGap.exec("StreamDocViewerToolkitExtension.executeOpen", GetFunctionName(successCallback), GetFunctionName(errorCallback), json);
	}
};
